_require local "../../basis.smi"

structure Pthread =
struct

  type thread (= *)
  structure Thread =
  struct
    type thread = thread
    val create : (unit -> int) -> thread
    val detach : thread -> unit
    val join : thread -> int
    val exit : int -> unit
    val self : unit -> thread
    val equal : thread * thread -> bool
  end

  type mutex (= array)
  structure Mutex =
  struct
    type mutex = mutex
    val create : unit -> mutex
    val lock : mutex -> unit
    val unlock : mutex -> unit
    val trylock : mutex -> bool
    val destroy : mutex -> unit
  end

  type cond (= array)
  structure Cond =
  struct
    type cond = cond
    val create : unit -> cond
    val signal : cond -> unit
    val broadcast : cond -> unit
    val wait : cond * mutex -> unit
    val destroy : cond -> unit
  end

end
